package com.ktjy.springredis.service.impl;

import com.ktjy.springredis.entity.Student;
import com.ktjy.springredis.service.RedisService;
import com.ktjy.springredis.service.StudentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @return 13141
 * 2025/7/23
 * 15:21
 */
@Service("studentService")
public class StudentServiceImpl implements StudentService {
    @Resource
    private RedisService redisService;

    @Override
    public boolean insert(Student student) {
       return redisService.set(student.getId(), student);
    }

    @Override
    public boolean delete(String id) {
        return redisService.delete(id);
    }

    @Override
    public boolean update(Student student) {
        return redisService.update(student.getId(), student);
    }

    @Override
    public Object get(String id) {
        return redisService.get(id);
    }
}
